package com.tengju.bff.interfaces.covercharge.constant;
/**
 * 任务状态
 * @author cj
 */
public enum TaskStatusEnum {

    // 1处理中-2成功-3失败
    DEAL(1,"处理中"),

    SUCCESS(2,"成功"),

    FAIL(3,"失败")
    ;

    private TaskStatusEnum(Integer code,String descriptioin){
        this.code=code;
        this.descriptioin=descriptioin;
    }




    private Integer code;
    private String descriptioin;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescriptioin() {
        return descriptioin;
    }

    public void setDescriptioin(String descriptioin) {
        this.descriptioin = descriptioin;
    }

    public static TaskStatusEnum getStatusDesc (Integer code){
        for(TaskStatusEnum thisEnum : (TaskStatusEnum.values())){
            if(thisEnum.getCode().equals(code)){//如果传入的code与此枚举code相同，则返回此枚举
                return thisEnum;
            }
        }
        return null;
    }
}
